import request from '@/utils/request'

// 获取活动详情
export function getActivityDetail(id) {
  return request({
    url: `/activity/${id}`,
    method: 'get'
  })
}

// 获取活动列表
export function getActivityList(params) {
  return request({
    url: '/activity/list',
    method: 'get',
    params
  })
}

// 添加活动
export function addActivity(data) {
  return request({
    url: '/activity',
    method: 'post',
    data
  })
}

// 更新活动信息
export function updateActivity(data) {
  return request({
    url: '/activity',
    method: 'put',
    data
  })
}

// 删除活动
export function deleteActivity(id) {
  return request({
    url: `/activity/${id}`,
    method: 'delete'
  })
}

// 批量删除活动
export function batchDeleteActivity(ids) {
  return request({
    url: '/activity/batch',
    method: 'delete',
    data: { ids }
  })
}

// 更新活动状态
export function updateActivityStatus(data) {
  return request({
    url: '/activity/status',
    method: 'put',
    data
  })
} 